<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        nav ul {
            display: flex;
            overflow: hidden;
        }

        nav li {
            width: 80px;
            text-align: center;
            line-height: 40px;
            font-size: 14px;
            position: relative;
        }

        nav a {
            display: block;
            transition: .3s;
        }

        .hide {
            width: 80px;
            height: 40px;
            position: absolute;
            top: 0;
            transform: translateY(100%);
            transition: .3s;
        }

        nav li:hover .hide {
            transform: translateY(0);
        }

        nav li:hover a {
            transform: translateY(-100%);
        }



        div {
            /* margin-top: 100px; */
        }

        div ul {
            display: flex;
            overflow: hidden;
        }

        div li {
            width: 80px;
            text-align: center;
            line-height: 40px;
            font-size: 14px;
            position: relative;
        }

        div a {
            display: block;
            transition: .3s;
        }

        div li:after {
            /* content: "home"; */
            /* attr  attribute 属性 */
            content: attr(ww);
            width: 80px;
            height: 40px;
            position: absolute;
            top: 0;
            left: 0;
            transform: translateY(100%);
            transition: .3s;
        }

        div li:hover:after {
            transform: translateY(0);
        }

        div li:hover a {
            transform: translateY(-100%);
        }
    </style>
</head>

<body>
    <nav>
        <ul>
            <li>
                <a href="">首页</a>
                <div class="hide">home</div>
            </li>
            <li>
                <a href="">关于</a>
                <div class="hide">about</div>
            </li>
            <li>
                <a href="">首页</a>
            </li>
            <li>
                <a href="">首页</a>
            </li>
            <li>
                <a href="">首页</a>
            </li>
        </ul>
    </nav>



    <div>
        <ul>
            <li ww="home">
                <a href="">首页</a>
            </li>
            <li ww="about">
                <a href="">首页</a>
            </li>
            <li ww="contact">
                <a href="">首页</a>
            </li>
            <li ww="news">
                <a href="">首页</a>
            </li>
        </ul>
    </div>




</body>

</html>